local skel = fk.CreateSkill {
  name = "emo__qunlie",
}

Fk:loadTranslationTable{
  ["emo__qunlie"] = "群猎",
  [":emo__qunlie"] = "出牌阶段限一次，你可以弃置任意张牌，令等量的角色获得1枚<a href='hunting_mark'>“狩猎”</a>标记。",

  ["#emo__qunlie"] = "群猎：弃置任意张牌，令等量名角色获得1枚“狩猎”标记",
  ["hunting_mark"] = "“狩猎”标记：受到有来源的1点伤害时，移除1个标记，令伤害来源摸一张牌。",
}

skel:addEffect("active", {
  anim_type = "control",
  prompt = "#emo__qunlie",
  times = function (self, player)
    return 1 - player:usedSkillTimes(self.name, Player.HistoryPhase)
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
  end,
  min_card_num = 1,
  card_filter = function (self, player, to_select)
    return not player:prohibitDiscard(Fk:getCardById(to_select))
  end,
  min_target_num = 1,
  target_filter = function (self, player, to_select, selected, selected_cards)
    return #selected < #selected_cards
  end,
  feasible = function (self, player, selected, selected_cards)
    return #selected > 0 and #selected_cards == #selected
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    room:throwCard(effect.cards, self.name, player, player)
    room:addSkill("#hunting_trigger")
    for _, to in ipairs(effect.tos) do
      if not to.dead then
        room:addPlayerMark(to, "@!!hunting")
      end
    end
  end,
})

return skel
